package lab02.test36;

public class Test36 {
    public static void main(String[] args) {
        Student students[] = new Student[5];

        students[0] = new Undergraduate("张三");
        students[1] = new Undergraduate("李四");
        students[2] = new Postgraduate("王五");
        students[3] = new Undergraduate("赵六");
        students[4] = new Postgraduate("陈七");

        int grade[] = new int[]{90, 95, 100};


        students[0].calculateGrade(grade);

        grade[0] = 80;
        grade[1] = 85;
        grade[2] = 90;
        students[1].calculateGrade(grade);

        grade[0] = 82;
        grade[1] = 85;
        grade[2] = 88;
        students[2].calculateGrade(grade);

        grade[0] = 75;
        grade[1] = 82;
        grade[2] = 87;
        students[3].calculateGrade(grade);

        grade[0] = 80;
        grade[1] = 82;
        grade[2] = 84;
        students[4].calculateGrade(grade);

        System.out.println("姓名" + "   " + "类型" + "  " + "成绩");
        for (int i = 0; i < 5; i++) {

            System.out.println(students[i].getName() + "  "
                    + students[i].getSort() + "    " + students[i].getCourseGrade());
        }
    }
}
